package com.zsj.domain.result;

/**
 * 枚举状态码
 */
public enum ResultCode {

    SUCCESS(1, "成功"),
    /* 参数错误 1001~1999 */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAM_IS_BLANK(1002, "参数为空"),
    PARAM_TYPE_BIND_REEOR(1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(1003, "参数缺失"),

    /* 用户错误 2001~2999 */
    USER_NOT_LOGGED_IN(2001, "用户未登陆，访问路径需要验证，请登录"),
    USER_LOGGED_ERROR(2002, "账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(2003, "用户已被禁用"),
    USER_NOT_EXISTS(2004, "用户不存在"),
    USER_HAS_EXISTS(2005, "用户已存在"),
    ;

    private Integer code;
    private String message;

    /*
     * 构造函数默认是private，也只能是private。其他的话会编译错误!  
     */
    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }

}
